﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<title></title>
<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
<div class="box box-primary" id="more" style="width:110px;height:35px;background-color:#222c32;position:absolute;z-index:9999;left:850px;top:100px;display:none;font-size:12px;border-top-color:#222c32;">
            <div class="box-body home-message" id="moreOp" >
            </div>
        </div>
	<section class="content-header">
		<h1><spring:message code="message.lable.drugcatalogSTDsee"/></h1>
		 <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.drugcatalogStd"/></a></li>
        </ol>
	</section>
	<section class="content">
		<div class=" box box-success">
			<div class="box-body">
				 <div class="input">
				 	<div class="textalign1"><spring:message code="message.listForm.yaoPinMuLuMingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugcatalogName" name="drugcatalogName" placeholder="<spring:message code="message.listForm.yaoPinMuLuMingCheng"/>" />
                    </div>
                    <div class="textalign"><spring:message code="message.listForm.yaoPinMuLuBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugcatalogCode" name="drugcatalogCode" placeholder="<spring:message code="message.listForm.yaoPinMuLuBianMa"/>" />
                    </div>
                    <div class="textalign"><spring:message code="message.listForm.yaoPinMuLuMingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugcatalogName" name="drugcatalogName" placeholder="<spring:message code="message.listForm.yaoPinMuLuMingCheng"/>" />
                    </div>
                 </div>
                 <div class="input">
                    <div class="textalign1"><spring:message code="message.listForm.pinGuiBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="qualityspecCode" name="qualityspecCode" placeholder="<spring:message code="message.listForm.pinGuiBianMa"/>" />
                    </div>
                    <div class="textalign"><spring:message code="message.listForm.pinGuiMingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="qualityspecName" name="qualityspecName" placeholder="<spring:message code="message.listForm.pinGuiMingCheng"/>" />
                    </div>
                    <div class="textalign"><spring:message code="message.lable.status"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <select class="textinput" name="status" id="status">
                            <option value=""><spring:message code="message.select.option"/></option>
                            <option value="1"><spring:message code="message.button.start"/></option>
                            <option value="0"><spring:message code="message.button.stop"/></option>
                        </select>
                    </div>
                 </div>
                 <div class="input">
                    <div class="textalign" >
                    <input type="button" id="selectDicCompType" onclick="likeQuery();" class="btn btn-success btn-sm" value="<spring:message code="message.button.seachSpacing"/>">
                </div>
                </div>
            </div>
        </div>
		<table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
	    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
        $(function () {

        	//加载页面光标在名字框内，位于第一个
            $("#drugcatalogName").focus();
            
            //绑定回车    
            $('#drugcatalogName,#drugcatalogCode,#qualityspecCode,#qualityspecName,#status').bind('keydown', function(event) {
                if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
                    $('#selectDicCompType').click();
                }
            }); 
            

            $("#gridlist").jqGrid({
                url: "getStdDrugcatalogDatas.html",
                mtype: "POST",
                datatype: "json",
                autowidth: true,
                height: 300,                   	
                colNames: [
                           '<spring:message code="message.jqGrid.cz"/>', 
                           '<spring:message code="message.listForm.yaoPinMuLu"/>id',
                           '<spring:message code="message.listForm.yaoPinMuLuBianMa"/>',
                           '<spring:message code="message.listForm.yaoPinMuLuMingCheng"/>',
                           '<spring:message code="message.listForm.pinGuiBianMa"/>',
                           '<spring:message code="message.listForm.pinGuiMingCheng"/>',
                           '<spring:message code="message.listForm.QiYongRiQi"/>', 
                           '<spring:message code="message.listForm.tingYongRiQi"/>',
                           '<spring:message code="message.listForm.leiXing"/>',
                           '<spring:message code="message.lable.status"/>'
                           
                           ],
                colModel: [
                       { name: 'operate', width: "3%", align:"center",sortable: false,
	                          formatter : function(val, opts, rowdata) {
		                        var str =  ""; 
		                        str+="<ms:btn url='/produceDrugcatalog/toStdDrugcatalogDetailInfo.html'><a href='${ctx}/produceDrugcatalog/toStdDrugcatalogDetailInfo.html?drugcatalogId="+rowdata.drugcatalogId+"&drugcatalogName="+rowdata.drugcatalogName+" '  style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a></ms:btn>";
		                        return str;
	                             }
                        },
						{ name: 'drugcatalogId',hidden:true, width: "0%",align: 'center',sortable: false},		
						{ name: 'drugcatalogCode', width: "15%",align: 'center',sortable: false},
						{ name: 'drugcatalogName', width: "15%",align: 'left' ,sortable: false},
						{ name: 'qualityspecCode', width: "15%",align: 'center',sortable: false},
						{ name: 'qualityspecName', width: "15%",align: 'left' ,sortable: false},
						{ name: 'startTime', width: "10%",align: 'center',sortable: false},
						{ name: 'endTime', width: "10%", align: 'center',sortable: false},
						{ name: 'attribute', width: "10%", align: 'center',sortable: false,
                            formatter : function(val, opts, rowdata) {
                            	  var temp='<spring:message code="message.listForm.qiTa"/>';
                                  if(val == 0){temp = '<spring:message code="message.listForm.guoJiaMuLu"/>';}
                                  else if (val == 1){ temp = '<spring:message code="message.listForm.shengZengBuMuLu"/>'; }
                                  return temp;
                            }
                        },
                        { name: 'status', width: "5%", align: 'center',sortable: false,
                            formatter : function(val, opts, rowdata) {
                            	if(val==1){
                                    return "<spring:message code="message.button.start"></spring:message>";
                                }else if(val==0){
                                    return "<span class='red'><spring:message code="message.button.stop"></spring:message></span>";
                                }
                            }
                        }
						
						
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                //multiselect: true, //勾选框
                caption: "<spring:message code="message.list.drugcatalogStdlist"/>",
                //序号宽度自动变化
                gridComplete:function(){
                    //序号列宽度自适应（参数为jqgridID）
                    autoRNWidth("gridlist");
                    //数据只有一条时默认选中（参数为jqgridID）
                    selectByOneData("gridlist");
                },
                jsonReader: {
                	repeatitems: false,
                	id: "compRegId"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
        });
        
        function likeQuery(){
        	var drugcatalogCode  = $("#drugcatalogCode").val();
       	    var drugcatalogName = $("#drugcatalogName").val();
       	    var qualityspecName = $("#qualityspecName").val();
       	    var qualityspecCode = $("#qualityspecCode").val();
       	    var status = $("#status").val();
	       	$("#gridlist").jqGrid('setGridParam', { 
	       		mtype:"post",
	       		postData:{
					"drugcatalogCode":drugcatalogCode,
					"drugcatalogName":drugcatalogName,
					"qualityspecName":qualityspecName,
					"qualityspecCode":qualityspecCode,
					"status":status
			    },
	       	    page: 1 
	       }).trigger("reloadGrid");
       }
        
    
    </script>
</body>
</html>